3.125 \(\int \frac{x \left (d+e x^2+f x^4+g x^6\right )}{a+b x^2+c x^4} \, dx\)

Optimal. Leaf size=149 \[ \frac{\log \left (a+b x^2+c x^4\right ) \left (-c (a g+b f)+b^2 g+c^2 e\right )}{4 c^3}-\frac{\tanh ^{-1}\left (\frac{b+2 c x^2}{\sqrt{b^2-4 a c}}\right ) \left (-c^2 (2 a f+b e)+b c (3 a g+b f)+b^3 (-g)+2 c^3 d\right )}{2 c^3 \sqrt{b^2-4 a c}}+\frac{x^2 (c f-b g)}{2 c^2}+\frac{g x^4}{4 c} \]

[Out]

((c*f - b*g)*x^2)/(2*c^2) + (g*x^4)/(4*c) - ((2*c^3*d - c^2*(b*e + 2*a*f) - b^3*
g + b*c*(b*f + 3*a*g))*ArcTanh[(b + 2*c*x^2)/Sqrt[b^2 - 4*a*c]])/(2*c^3*Sqrt[b^2
 - 4*a*c]) + ((c^2*e + b^2*g - c*(b*f + a*g))*Log[a + b*x^2 + c*x^4])/(4*c^3)

_______________________________________________________________________________________

Rubi [A]  time = 0.594175, antiderivative size = 149, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182 \[ \frac{\log \left (a+b x^2+c x^4\right ) \left (-c (a g+b f)+b^2 g+c^2 e\right )}{4 c^3}-\frac{\tanh ^{-1}\left (\frac{b+2 c x^2}{\sqrt{b^2-4 a c}}\right ) \left (-c^2 (2 a f+b e)+b c (3 a g+b f)+b^3 (-g)+2 c^3 d\right )}{2 c^3 \sqrt{b^2-4 a c}}+\frac{x^2 (c f-b g)}{2 c^2}+\frac{g x^4}{4 c} \]

Antiderivative was successfully verified.

[In]  Int[(x*(d + e*x^2 + f*x^4 + g*x^6))/(a + b*x^2 + c*x^4),x]

[Out]

((c*f - b*g)*x^2)/(2*c^2) + (g*x^4)/(4*c) - ((2*c^3*d - c^2*(b*e + 2*a*f) - b^3*
g + b*c*(b*f + 3*a*g))*ArcTanh[(b + 2*c*x^2)/Sqrt[b^2 - 4*a*c]])/(2*c^3*Sqrt[b^2
 - 4*a*c]) + ((c^2*e + b^2*g - c*(b*f + a*g))*Log[a + b*x^2 + c*x^4])/(4*c^3)

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ - \left (\frac{b g}{2} - \frac{c f}{2}\right ) \int ^{x^{2}} \frac{1}{c^{2}}\, dx + \frac{g x^{4}}{4 c} + \frac{\left (- a c g + b^{2} g - b c f + c^{2} e\right ) \log{\left (a + b x^{2} + c x^{4} \right )}}{4 c^{3}} + \frac{\left (- 3 a b c g + 2 a c^{2} f + b^{3} g - b^{2} c f + b c^{2} e - 2 c^{3} d\right ) \operatorname{atanh}{\left (\frac{b + 2 c x^{2}}{\sqrt{- 4 a c + b^{2}}} \right )}}{2 c^{3} \sqrt{- 4 a c + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(x*(g*x**6+f*x**4+e*x**2+d)/(c*x**4+b*x**2+a),x)

[Out]

-(b*g/2 - c*f/2)*Integral(c**(-2), (x, x**2)) + g*x**4/(4*c) + (-a*c*g + b**2*g
- b*c*f + c**2*e)*log(a + b*x**2 + c*x**4)/(4*c**3) + (-3*a*b*c*g + 2*a*c**2*f +
 b**3*g - b**2*c*f + b*c**2*e - 2*c**3*d)*atanh((b + 2*c*x**2)/sqrt(-4*a*c + b**
2))/(2*c**3*sqrt(-4*a*c + b**2))

_______________________________________________________________________________________

Mathematica [A]  time = 0.230919, size = 142, normalized size = 0.95 \[ \frac{\log \left (a+b x^2+c x^4\right ) \left (-c (a g+b f)+b^2 g+c^2 e\right )+\frac{2 \tan ^{-1}\left (\frac{b+2 c x^2}{\sqrt{4 a c-b^2}}\right ) \left (-c^2 (2 a f+b e)+b c (3 a g+b f)+b^3 (-g)+2 c^3 d\right )}{\sqrt{4 a c-b^2}}+2 c x^2 (c f-b g)+c^2 g x^4}{4 c^3} \]

Antiderivative was successfully verified.

[In]  Integrate[(x*(d + e*x^2 + f*x^4 + g*x^6))/(a + b*x^2 + c*x^4),x]

[Out]

(2*c*(c*f - b*g)*x^2 + c^2*g*x^4 + (2*(2*c^3*d - c^2*(b*e + 2*a*f) - b^3*g + b*c
*(b*f + 3*a*g))*ArcTan[(b + 2*c*x^2)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*c] + (
c^2*e + b^2*g - c*(b*f + a*g))*Log[a + b*x^2 + c*x^4])/(4*c^3)

_______________________________________________________________________________________

Maple [B]  time = 0.006, size = 357, normalized size = 2.4 \[{\frac{g{x}^{4}}{4\,c}}-{\frac{b{x}^{2}g}{2\,{c}^{2}}}+{\frac{f{x}^{2}}{2\,c}}-{\frac{\ln \left ( c{x}^{4}+b{x}^{2}+a \right ) ag}{4\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{4}+b{x}^{2}+a \right ){b}^{2}g}{4\,{c}^{3}}}-{\frac{\ln \left ( c{x}^{4}+b{x}^{2}+a \right ) bf}{4\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{4}+b{x}^{2}+a \right ) e}{4\,c}}+{\frac{3\,abg}{2\,{c}^{2}}\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{fa}{c}\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+{d\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{{b}^{3}g}{2\,{c}^{3}}\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+{\frac{{b}^{2}f}{2\,{c}^{2}}\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{be}{2\,c}\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(x*(g*x^6+f*x^4+e*x^2+d)/(c*x^4+b*x^2+a),x)

[Out]

1/4*g*x^4/c-1/2/c^2*x^2*b*g+1/2*f*x^2/c-1/4/c^2*ln(c*x^4+b*x^2+a)*a*g+1/4/c^3*ln
(c*x^4+b*x^2+a)*b^2*g-1/4/c^2*ln(c*x^4+b*x^2+a)*b*f+1/4/c*ln(c*x^4+b*x^2+a)*e+3/
2/c^2/(4*a*c-b^2)^(1/2)*arctan((2*c*x^2+b)/(4*a*c-b^2)^(1/2))*a*b*g-1/c/(4*a*c-b
^2)^(1/2)*arctan((2*c*x^2+b)/(4*a*c-b^2)^(1/2))*f*a+1/(4*a*c-b^2)^(1/2)*arctan((
2*c*x^2+b)/(4*a*c-b^2)^(1/2))*d-1/2/c^3/(4*a*c-b^2)^(1/2)*arctan((2*c*x^2+b)/(4*
a*c-b^2)^(1/2))*b^3*g+1/2/c^2/(4*a*c-b^2)^(1/2)*arctan((2*c*x^2+b)/(4*a*c-b^2)^(
1/2))*b^2*f-1/2/c/(4*a*c-b^2)^(1/2)*arctan((2*c*x^2+b)/(4*a*c-b^2)^(1/2))*b*e

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x^6 + f*x^4 + e*x^2 + d)*x/(c*x^4 + b*x^2 + a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [A]  time = 0.356744, size = 1, normalized size = 0.01 \[ \left [\frac{{\left (2 \, c^{3} d - b c^{2} e +{\left (b^{2} c - 2 \, a c^{2}\right )} f -{\left (b^{3} - 3 \, a b c\right )} g\right )} \log \left (-\frac{b^{3} - 4 \, a b c + 2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} x^{2} -{\left (2 \, c^{2} x^{4} + 2 \, b c x^{2} + b^{2} - 2 \, a c\right )} \sqrt{b^{2} - 4 \, a c}}{c x^{4} + b x^{2} + a}\right ) +{\left (c^{2} g x^{4} + 2 \,{\left (c^{2} f - b c g\right )} x^{2} +{\left (c^{2} e - b c f +{\left (b^{2} - a c\right )} g\right )} \log \left (c x^{4} + b x^{2} + a\right )\right )} \sqrt{b^{2} - 4 \, a c}}{4 \, \sqrt{b^{2} - 4 \, a c} c^{3}}, \frac{2 \,{\left (2 \, c^{3} d - b c^{2} e +{\left (b^{2} c - 2 \, a c^{2}\right )} f -{\left (b^{3} - 3 \, a b c\right )} g\right )} \arctan \left (-\frac{{\left (2 \, c x^{2} + b\right )} \sqrt{-b^{2} + 4 \, a c}}{b^{2} - 4 \, a c}\right ) +{\left (c^{2} g x^{4} + 2 \,{\left (c^{2} f - b c g\right )} x^{2} +{\left (c^{2} e - b c f +{\left (b^{2} - a c\right )} g\right )} \log \left (c x^{4} + b x^{2} + a\right )\right )} \sqrt{-b^{2} + 4 \, a c}}{4 \, \sqrt{-b^{2} + 4 \, a c} c^{3}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x^6 + f*x^4 + e*x^2 + d)*x/(c*x^4 + b*x^2 + a),x, algorithm="fricas")

[Out]

[1/4*((2*c^3*d - b*c^2*e + (b^2*c - 2*a*c^2)*f - (b^3 - 3*a*b*c)*g)*log(-(b^3 -
4*a*b*c + 2*(b^2*c - 4*a*c^2)*x^2 - (2*c^2*x^4 + 2*b*c*x^2 + b^2 - 2*a*c)*sqrt(b
^2 - 4*a*c))/(c*x^4 + b*x^2 + a)) + (c^2*g*x^4 + 2*(c^2*f - b*c*g)*x^2 + (c^2*e
- b*c*f + (b^2 - a*c)*g)*log(c*x^4 + b*x^2 + a))*sqrt(b^2 - 4*a*c))/(sqrt(b^2 -
4*a*c)*c^3), 1/4*(2*(2*c^3*d - b*c^2*e + (b^2*c - 2*a*c^2)*f - (b^3 - 3*a*b*c)*g
)*arctan(-(2*c*x^2 + b)*sqrt(-b^2 + 4*a*c)/(b^2 - 4*a*c)) + (c^2*g*x^4 + 2*(c^2*
f - b*c*g)*x^2 + (c^2*e - b*c*f + (b^2 - a*c)*g)*log(c*x^4 + b*x^2 + a))*sqrt(-b
^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*c^3)]

_______________________________________________________________________________________

Sympy [A]  time = 164.926, size = 789, normalized size = 5.3 \[ \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (3 a b c g - 2 a c^{2} f - b^{3} g + b^{2} c f - b c^{2} e + 2 c^{3} d\right )}{4 c^{3} \left (4 a c - b^{2}\right )} - \frac{a c g - b^{2} g + b c f - c^{2} e}{4 c^{3}}\right ) \log{\left (x^{2} + \frac{2 a^{2} c g - a b^{2} g + a b c f + 8 a c^{3} \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (3 a b c g - 2 a c^{2} f - b^{3} g + b^{2} c f - b c^{2} e + 2 c^{3} d\right )}{4 c^{3} \left (4 a c - b^{2}\right )} - \frac{a c g - b^{2} g + b c f - c^{2} e}{4 c^{3}}\right ) - 2 a c^{2} e - 2 b^{2} c^{2} \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (3 a b c g - 2 a c^{2} f - b^{3} g + b^{2} c f - b c^{2} e + 2 c^{3} d\right )}{4 c^{3} \left (4 a c - b^{2}\right )} - \frac{a c g - b^{2} g + b c f - c^{2} e}{4 c^{3}}\right ) + b c^{2} d}{3 a b c g - 2 a c^{2} f - b^{3} g + b^{2} c f - b c^{2} e + 2 c^{3} d} \right )} + \left (\frac{\sqrt{- 4 a c + b^{2}} \left (3 a b c g - 2 a c^{2} f - b^{3} g + b^{2} c f - b c^{2} e + 2 c^{3} d\right )}{4 c^{3} \left (4 a c - b^{2}\right )} - \frac{a c g - b^{2} g + b c f - c^{2} e}{4 c^{3}}\right ) \log{\left (x^{2} + \frac{2 a^{2} c g - a b^{2} g + a b c f + 8 a c^{3} \left (\frac{\sqrt{- 4 a c + b^{2}} \left (3 a b c g - 2 a c^{2} f - b^{3} g + b^{2} c f - b c^{2} e + 2 c^{3} d\right )}{4 c^{3} \left (4 a c - b^{2}\right )} - \frac{a c g - b^{2} g + b c f - c^{2} e}{4 c^{3}}\right ) - 2 a c^{2} e - 2 b^{2} c^{2} \left (\frac{\sqrt{- 4 a c + b^{2}} \left (3 a b c g - 2 a c^{2} f - b^{3} g + b^{2} c f - b c^{2} e + 2 c^{3} d\right )}{4 c^{3} \left (4 a c - b^{2}\right )} - \frac{a c g - b^{2} g + b c f - c^{2} e}{4 c^{3}}\right ) + b c^{2} d}{3 a b c g - 2 a c^{2} f - b^{3} g + b^{2} c f - b c^{2} e + 2 c^{3} d} \right )} + \frac{g x^{4}}{4 c} - \frac{x^{2} \left (b g - c f\right )}{2 c^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x*(g*x**6+f*x**4+e*x**2+d)/(c*x**4+b*x**2+a),x)

[Out]

(-sqrt(-4*a*c + b**2)*(3*a*b*c*g - 2*a*c**2*f - b**3*g + b**2*c*f - b*c**2*e + 2
*c**3*d)/(4*c**3*(4*a*c - b**2)) - (a*c*g - b**2*g + b*c*f - c**2*e)/(4*c**3))*l
og(x**2 + (2*a**2*c*g - a*b**2*g + a*b*c*f + 8*a*c**3*(-sqrt(-4*a*c + b**2)*(3*a
*b*c*g - 2*a*c**2*f - b**3*g + b**2*c*f - b*c**2*e + 2*c**3*d)/(4*c**3*(4*a*c -
b**2)) - (a*c*g - b**2*g + b*c*f - c**2*e)/(4*c**3)) - 2*a*c**2*e - 2*b**2*c**2*
(-sqrt(-4*a*c + b**2)*(3*a*b*c*g - 2*a*c**2*f - b**3*g + b**2*c*f - b*c**2*e + 2
*c**3*d)/(4*c**3*(4*a*c - b**2)) - (a*c*g - b**2*g + b*c*f - c**2*e)/(4*c**3)) +
 b*c**2*d)/(3*a*b*c*g - 2*a*c**2*f - b**3*g + b**2*c*f - b*c**2*e + 2*c**3*d)) +
 (sqrt(-4*a*c + b**2)*(3*a*b*c*g - 2*a*c**2*f - b**3*g + b**2*c*f - b*c**2*e + 2
*c**3*d)/(4*c**3*(4*a*c - b**2)) - (a*c*g - b**2*g + b*c*f - c**2*e)/(4*c**3))*l
og(x**2 + (2*a**2*c*g - a*b**2*g + a*b*c*f + 8*a*c**3*(sqrt(-4*a*c + b**2)*(3*a*
b*c*g - 2*a*c**2*f - b**3*g + b**2*c*f - b*c**2*e + 2*c**3*d)/(4*c**3*(4*a*c - b
**2)) - (a*c*g - b**2*g + b*c*f - c**2*e)/(4*c**3)) - 2*a*c**2*e - 2*b**2*c**2*(
sqrt(-4*a*c + b**2)*(3*a*b*c*g - 2*a*c**2*f - b**3*g + b**2*c*f - b*c**2*e + 2*c
**3*d)/(4*c**3*(4*a*c - b**2)) - (a*c*g - b**2*g + b*c*f - c**2*e)/(4*c**3)) + b
*c**2*d)/(3*a*b*c*g - 2*a*c**2*f - b**3*g + b**2*c*f - b*c**2*e + 2*c**3*d)) + g
*x**4/(4*c) - x**2*(b*g - c*f)/(2*c**2)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.298245, size = 197, normalized size = 1.32 \[ \frac{c g x^{4} + 2 \, c f x^{2} - 2 \, b g x^{2}}{4 \, c^{2}} - \frac{{\left (b c f - b^{2} g + a c g - c^{2} e\right )}{\rm ln}\left (c x^{4} + b x^{2} + a\right )}{4 \, c^{3}} + \frac{{\left (2 \, c^{3} d + b^{2} c f - 2 \, a c^{2} f - b^{3} g + 3 \, a b c g - b c^{2} e\right )} \arctan \left (\frac{2 \, c x^{2} + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{2 \, \sqrt{-b^{2} + 4 \, a c} c^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x^6 + f*x^4 + e*x^2 + d)*x/(c*x^4 + b*x^2 + a),x, algorithm="giac")

[Out]

1/4*(c*g*x^4 + 2*c*f*x^2 - 2*b*g*x^2)/c^2 - 1/4*(b*c*f - b^2*g + a*c*g - c^2*e)*
ln(c*x^4 + b*x^2 + a)/c^3 + 1/2*(2*c^3*d + b^2*c*f - 2*a*c^2*f - b^3*g + 3*a*b*c
*g - b*c^2*e)*arctan((2*c*x^2 + b)/sqrt(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*c^3)